<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0047)./Article_Vote.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>
	榆林科技馆内容页
</title><link rel="stylesheet" type="text/css" href="./css/reset.css">
<link rel="stylesheet" type="text/css" href="./css/main.css">
    <script type="text/javascript" src="./css/adddate.js"></script>
    <script src="../js/vue2.min.js"></script>
    <script src="../js/axios.min.js"></script>
</head>
<body>
    <form name="form1" method="post" action="./Article_Vote.html" id="form1">


<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


    <!--条件检索-->
    <div class="main_box">
        <div class="side_here">
            <p>
                <a href="./Article_Vote.html#" title="首页"></a>当前位置 &gt; <span>系统设置</span> &gt; <span>
                    数据备份</span></p>
        </div>
        <div id="div1">

        <!--公用位置导航结束-->
        <div class="cont_box">
            <p class="title_bt">
                数据库安全操作</p>
            <table class="table_list1" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                        <td align="center" style="margin-left:20px;">
                            
                            <input type="submit" id="bkBtn" name="BtnArticle_Vote" value="备份数据库" @click="myBk()" id="BtnArticle_Vote" class="btn_d btn-secondary radius">
                            <span style="color: #f00">特别提醒: 备份的数据库在AccData文件夹下，为保证数据安全，请定时备份数据库。</span>
                            <span id="Label1"></span>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <!--表格选项-->
        <div class="cont_box">
            <p class="title_bt">
                备份记录</p>
            <table width="1060" border="0" cellpadding="0" cellspacing="0" class="table_list2">
                <tbody><tr>
                    <th width="4%">
                        编号
                    </th>
                    <th width="15%">
                        备份人
                    </th>
                    <th width="27%">
                        备份时间
                    </th>
                    <th width="25%">
                        备份路径
                    </th>
                    <th width="15%">
                        备份IP
                    </th>
                    <th width="8%">
                        操作
                    </th>
                </tr>
                
                        <tr v-for="db in dbBacks">
                            <td>
                                {{db.bkID}}
                            </td>
                            <td>
                                {{db.bkUser}}
                            </td>
                            <td>
                                {{db.bkDate}}
                            </td>
                            <td>
                                {{db.bkPath}}
                            </td>
                            <td>
                                {{db.bkIP}}
                            </td>
                            <td>
                                <input type="button" @click="del(db.bkID)" name="Repeater1$ctl00$btndel" value="" onclick="return confirm(&#39;确定要删除吗？&#39;);" id="Repeater1_ctl00_btndel" class="btn btn_an btn_del" title="删除">
                            </td>
                        </tr>
                    
            </tbody></table>
        <!--页码开始-->
            <div class="pages" style="margin-top: 40px;">
                <ul class="yema">
                    <li style="border-left: none;">
                        <a id="Lbthead" class="pagebtn" href="javascript:__doPostBack(&#39;Lbthead&#39;,&#39;&#39;)">首页</a></li>
                    <li>
                        <a id="Lbtpre" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtpre&#39;,&#39;&#39;)">上一页</a></li>
                    <li>
                        <a id="Lbtnext" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtnext&#39;,&#39;&#39;)">下一页</a></li>
                    <li>
                        <a id="Lbtend" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtend&#39;,&#39;&#39;)">尾页</a></li>
                    <div class="clear">
                    </div>
                </ul>
                <div class="searchPage">
                    <span class="page-sum">共<strong class="allPage">&nbsp;1
                    </strong>页</span><span class="page-sum">第<strong class="allPage">&nbsp;1
                    </strong>页</span> <span class="page-go">跳转第
                        <input name="Txtpageno" type="text" id="Txtpageno" class="pagebtn" size="3" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;)" style="ime-mode: disabled">页</span>
                    <a id="BtngoPage" class="page-btn" href="javascript:__doPostBack(&#39;BtngoPage&#39;,&#39;&#39;)">GO</a>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    </div>
    <!--页码结束-->
    <!--按钮元素-->
    </form>
<script>
    var bk = new Vue({
        el:'#div1',
        data:{
            dbBacks:[

            ]
        },
        methods:{
            myBk:function (){
                alert("bk111");
                var btn = document.getElementById("bkBtn");
                btn.disabled = true;
                var url ="/user?action=backUp";
                axios.get(url)
                    .then(res=>{
                        if (res.data=="success"){
                            btn.disabled = false;
                        }
                    });
                init();
            },
            del:function (bkID) {
                if (window.confirm("你确定删除吗?")){
                    var url ="/bk?action=delete&bkID="+bkID;
                    axios.get(url)
                        .then(res=>{
                            if (res.data=="success"){
                                for (var i=0;i<bk.dbBacks.length;i++){
                                    if (bk.dbBacks[i].bkID==bkID){
                                        bk.dbBacks.slice(i,1);
                                    }
                                }
                                init();
                            }
                        });
                }
            },
        }
    });
    window.onload = init;
    function init(){
        var url = "/bk?action=findAll";
        axios.get(url).then(res=>{
            bk.dbBacks = res.data;
        });
    }
</script>

</body></html>